package t3invoke;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

import t3bean.ParkingSpaceBean;
import t3dao.ParkingSpaceDao;

public class ShowParkingSpaceAction implements Action {

	@Override
	public void showParkingSpace() {
		ParkingSpaceDao psd=new ParkingSpaceDao();
		List<ParkingSpaceBean> list=new ArrayList<>();
		try {
			list=psd.select(null);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		for(ParkingSpaceBean psb:list) {
			System.out.println("停车位"+psb.getSpaceId());
			if(psb.getIsParking()==0||psb.getCarid().equals("null")) {
				System.out.println("未有车停靠");
			}else {
				System.out.println("停靠车:"+psb.getCarid());
			}
			System.out.println();
		}

	}

	@Override
	public void parkCar(Scanner sc) {
	}

	@Override
	public void getCar(Scanner sc) {
	}

	@Override
	public void showMoneyRecord() {
	}

}
